{% extends "template/listEdit.volt" %}

{% block title %}问题反馈列表{% endblock %}


{% block filter %}
    <div class="col-md-4 col-sm-6 col-xs-12">
        <table>
            <tr>
                <th>问题ID:</th>
                <td><input type="text" name="id" value="" data-valid="integer"></td>
            </tr>
            <tr>
                <th>提交用户:</th>
                <td><input type="text" name="nickname" value=""></td>
            </tr>
            <tr>
                <th>状态:</th>
                <td><select name="state">
                        <option value="">请选择</option>
                        <option value="0">待处理</option>
                        <option value="1">处理中</option>
                        <option value="2">已解决</option>
                        <option value="3">已回复</option>
                    </select></td>

            </tr>
        </table>
    </div>
    <div class="col-md-4 col-sm-6 col-xs-12">
        <table>
            <tr>
                <th>问题:</th>
                <td><input type="text" name="question_title" value=""></td>
            </tr>
            <tr>
                <th>提交用户手机号:</th>
                <td><input type="text" name="user_phone" value=""></td>
            </tr>
        </table>
    </div>
    <div class="col-md-4 col-sm-6 col-xs-12">
        <table>
            <tr>
                <th>说明:</th>
                <td><input type="text" name="question_desc" value=""></td>
            </tr>
            <tr>
                <th>提交时间:</th>
                <td><input type="date-h" name="created_at_start" data-attr="date" id="question-date-start"
                    value="">-<input type="date-h" name="created_at_end" data-attr="date right" class="end"
                                     value=""></td>
            </tr>
            <tr>
                <td colspan="2">
                    <div id="btn_reset_param" class="btn-0 button">重 置</div>
                    <div id="btn_search_data" class="btn-1 button">过 滤</div>
                </td>
            </tr>
        </table>
    </div>
{% endblock %}

{% block hiddenOperation %}hidden{% endblock %}

{% block jscontent %}
    <script>


        $(function () {
            PageDataProxy.init({
                "url": "/setting/listRequestQuestion",
                "action_detail_url": "/setting/editor",
                "table_id": "#mytable",
                "page_control_id": "#data-wrap",
                "page_size_id": "#rows-perpage-select",
                "page_total_id": "#data_count_total",
                "use_check_box": false,
                "data_field_process": function (name, value) {


                    if(name=="id"){
                        return "<a href='javascript:void(0)' onclick=PageDataProxy.actionDetail('id=" + value + "')>"+value+"</a>";
                    }
                    if(name=="state"){
                        var color="black";
                        if(value=="待处理"){
                            color="#1F61D3;";
                        }
                        if(value=="处理中"){
                            color="#FFB60F;";
                        }
                        if(value=="已解决"){
                            color="#53D31F;";
                        }
                        if(value=="已回复"){
                            color="#C600FF;";
                        }
                        return '<p style="color:'+color+'">'+value+'<p>';
                    }
                    return value;
                },
                "table_style": {
                    "state":"width-m",
                    "request_user_id":"width-150",
                    "operation_user_id":"width-150",
                    "question_title":"width-m",
                    "question_desc":"width-550",
                    "request_user_info":"width-m",
                    "created_at": "width-m"
                },
                "data_field_action_process": function (tag) {
                    return "<td onclick=PageDataProxy.actionDetail('id=" + tag + "')><img class='action-show-icon'>详细</td>";
                },

            });
            $("#btn_reset_param").click(function () {
                $("#drone-filter input").each(function () {
                    $(this).val("");
                });
            });
            $("#btn_search_data").click(function () {
                PageDataProxy.refresh();
            });


        })
    </script>
{% endblock %}